package org.example.springkafka.Controller;

import org.example.springkafka.POJO.User;
import org.example.springkafka.Producer.KafkaProducer1;
import org.example.springkafka.Producer.TransactionProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class KafkaController {
    @Autowired
    private KafkaProducer1 kafkaProducer1;

    @Autowired
    private TransactionProducer transactionProducer;
    @GetMapping("/send/User")
    public String sendUser() {
        kafkaProducer1.sendUser();
        return "success";
    }

    @GetMapping("/send/String")
    public String sendString() {
        transactionProducer.sendString();
        return "success";
    }
}
